programming4us
           
 
 
SQL Server

Microsoft SQL Server 2008 R2 : Setting Up Replication (part 4) - Creating Subscriptions

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/14/2011 9:28:43 AM

Creating Subscriptions

Now that you have installed and configured the distributor, enabled publishing, and created a publication, you can create subscriptions.

Remember that two types of subscriptions can be created: push or pull. Pull subscriptions allow remote sites to subscribe to any publication that they are allowed to, but for this to work, you must be confident that the administrators at the other sites have properly configured the subscriptions at their sites. Push subscriptions are easier to create because all the subscription processes are performed and administered from the publication/distributor point of view. This also makes using them the most common approach.

For this example, we use the New Subscription Wizard to create a push subscription:

1.
In SQL Server Management Studio, locate the Replication node under the publication server (the DBARCH-LT2\SQL08DE01 named instance in this example) or the Replication node under the subscription server (the DBARCH-LT2\SQL08DE03 named instance in this example). You can create a push subscription from either (but we use the subscription server here). Open the Replication node, navigate to the Local Subscription branch, right-click, and choose the New Subscriptions option. As you can see in Figure 22, choosing this option launches the New Subscription Wizard, where you can create one or more subscriptions to a publication and specify where and when to run the agents that synchronize the subscription.



Figure 22. Launching the New Subscription Wizard from SQL Server Management Studio.

2.
You first need to identify the publisher and publication from which you want to create one or more subscriptions. As you can see in Figure 23, we have specified the publisher (DBARCH-LT2\SQL08DE01) and the publication that has been created for the AdventureWorks2008 database.

Figure 23. Identifying the publication from which to subscribe.

3.
When you are presented with the option of where the replication agents will be run for the subscription, choose the first option—having the agents run at the distributor. This makes it a push subscription, which is much easier to control and manage centrally than a pull subscription (as shown in Figure 24).

Figure 24. Run all agents at the Distributor (push subscriptions).

4.
Next, the New Database dialog appears, asking you to identify the database target for the subscription and the physical database files for its allocation (assuming that you want to create this from scratch using this wizard process). Figure 25 shows this New Database dialog, with the target database named AdventureWorks2008ODS. Essentially, we have decided to create a subscription that will continuously flow data from the publisher to the subscriber for all tables in the publication. This continuous replication at the transactional level effectively creates a mirror image of the data for operational usage. That’s why we have used the suffix ODS, for Operational Data Store, for the new database. This is a typical industry usage of replication that takes all read-only access to OLTP data and offloads it to the ODS copy of the same data (which is as close to up-to-date as the last transaction that was replicated to it).

Figure 25. The New Database dialog specifying the target database (AdventureWorks2008ODS).

5.
In the Subscribers screen, with the new entry for the target subscriber server (the DBARCH-LT2\SQL08DE03 named instance in this example), check the box for the target subscription server. Figure 26 shows this subscriber server and the subscription database target.

Figure 26. Specifying the subscription server target database.


6.
Specify the process account and connection options for the distribution agent (to connect to the subscription server). Typically, you choose the option to use a domain account or choose to impersonate the process account (shown in Figure 27).

Figure 27. Distribution Agent Security and Synchronization Schedule for the subscription (Run Continuously).

7.
Specify the synchronization schedule for each agent. You want the distribution agent to run continuously, but you also have the options to run on a schedule and on demand (as shown in Figure 27).

 

8.
Specify the initialization of the subscription. You want the subscription to be initialized immediately, but, depending on the size of the database, this might be accomplished manually with a database backup of the publication database.

9.
On the next screen, which lists the New Subscription Wizard actions, choose to create the subscription and generate a script file with all the steps to create the subscription for use later.

10.
On the next wizard dialog, identify the location of the script to be generated. As shown in Figure 28, you are presented with the final wizard summary screen. Click Finish to create your subscription, initialize the subscription database, and enjoy a full transactional replication implementation.

Figure 28. The New Subscription Wizard summary.

After you click Finish, the create subscription process starts and goes through each step. Remember to check for errors or warnings if any errors occur. When this process completes, you wait for the agents to initialize the target database and start replication to the subscriber. If you have specified that the schema and data be created immediately, things start happening quickly. The distribution agent finishes the job. As you can see in Figure 29, the distribution agent applies the schemas to the subscriber (as viewed from the Replication Monitor’s Distributor to Subscriber History tab). The bulk copying of the data into the tables on the subscriber side follows accordingly. After this bulk copying is done, the initialization step is completed, and active replication begins.



Figure 29. Delivering schemas and data to the subscriber.

The complete replication buildup is finished, and you should be fully functional for replicating transactions to the subscriber.

Figure 30 shows what the replication buildup looks like from the Replication Monitor as transactions flow through the replication topology. This screenshot shows the transaction counts and commands being delivered on the last leg in the journey (from the distributor to a subscriber). Figure 31 shows the full replication topology that was built (Publisher, Distributor and Subscriber).

Figure 30. Transactions replicating to the subscriber (pushed).

Figure 31. Full replication topology that was built (Publisher, Distributor, Subscriber).

Your replication topology is now completely functional and will replicate flawlessly for as long as you require.

Other -----------------
- SQL Server 2008 R2 : Basing the Replication Design on User Requirements
- SQL Server 2008 R2 : Planning for SQL Server Data Replication & SQL Server Replication Types
- SQL Server 2008 R2 : Replication Agents
- SQL Server 2008 : Replication - Subscriptions
- SQL Server 2008 : Replication Scenarios
- Protecting SQL Server Data : CELL-LEVEL ENCRYPTION - Special Considerations
- Protecting SQL Server Data : SCHEMA ARCHITECTURE STRATEGIES - Harnessing Linked Servers
- Monitoring SQL Server 2005 Performance : Using Windows System Monitor & Using SQL Server Profiler
- Monitoring SQL Server 2005 Performance : Monitoring and Recording Performance
- SQL Server 2008 R2 : Replication - The Publisher, Distributor, and Subscriber Magazine Metaphor
- SQL Server 2008 R2 : Replication - What Is Replication?
- SQL Server 2008 High Availability : Other HA Techniques That Yield Great Results & High Availability from the Windows Server Family Side
- SQL Server 2008 High Availability : Building Solutions with One or More HA Options
- SQL Server 2008 High Availability : The Fundamentals of HA
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 4)
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 3) - Performing a Database Backup
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 2) - Common OS-Related Tasks
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 1) - General Tasks & Scheduling Scripts
- PowerShell in SQL Server 2008
- Protecting SQL Server Data : SCHEMA ARCHITECTURE STRATEGIES - Using Database Object Schemas
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us